<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>RegExp</title>

  <style>


  </style>
</head>
<body>



  <script>
    
// 1
    // let str = prompt("enter something")

    // let reg = new RegExp("[我窝喔][草操曹]")//3*3=9种
    // let reg2 = /[我窝喔][草操曹]/

    // let i = str.search(reg2)

    // if(i != -1){
    //   document.write("有敏感词，禁止发送")
    // }else{
    //   document.write(`俺说：${str}`)
    // }
  

//2   双斜杠不能完全和RegExp替换，比如\转义的反斜杠，会冲突
    //phone

    let phone = prompt("phone")
    let regPhone = /^1[3-9]\d{9}$/
    let result = regPhone.test(phone)
    if(result == true){
      document.write(`ok`)
    }else{
      document.write(`false`)
    }


  </script>

</body>
</html>